package springTaskExecutor.example;

import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * @author CKC
 * @DateTime 2021/12/12 18:04
 */
@Component
public class AsyncExample {
    /**
     * 使用@Async  需要在配置类上开启 @EnableAsync
     */
    @Async(value = "taskExecutor")
    public void getInfo(String type) {
        System.out.println(Thread.currentThread().getName() + "\t" + "hello world!!" + type);
    }
}
